QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Simple Polygons

A simple polygon is a closed plane figure defined by a list of vertices. (In other words, a simple polygon is a polygon defined by a single contour.) The edges of a simple polygon should not intersect themselves or you will get unpredictable results when operating on the polygon. In addition, a simple polygon must be convex.

The entire simple polygon can have a set of attributes, and any or all of the vertices defining the polygon can have a set of attributes.

A simple polygon is defined by the TQ3PolygonData data type. See "Creating and Editing Simple Polygons" for a description of the routines you can use to create and edit simple polygons. Figure 22 shows a simple polygon.

Figure 22 A simple polygon

typedef struct TQ3PolygonData {
    unsigned long                       numVertices;
    TQ3Vertex3D                         *vertices;
    TQ3AttributeSet                     polygonAttributeSet;
} TQ3PolygonData;
numVertices
The number of vertices in the simple polygon. The value of this field must be at least 3.
vertices
A pointer to an array of vertices that define the simple polygon.
polygonAttributeSet
A set of attributes for the simple polygon. The value in this field is NULL if no polygon attributes are defined.

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |